package Create

import "github.com/gogf/gf/v2/frame/g"

/*
The information of a problem when user create a problem:
Title: title;
Tag: tag;
Rank: using number like 1400 to be the rank;
Author: dont need to sent to the server, server will get ur name when u pass the auth;
Dc: the main dc of the problem;
Input: input;
Output: output;
ExDc: extra dc of the problem like N <= 1e5 and so on;
Limit Dc: the time and memory limit of the problem;
Contest: where is the contest the problem belong;

So u only need to send data except author;
*/

/*
Input and output use same struct to make the data:
cnt: the number of items, if cnt == 0 means that every test file only have one test case;
data: the different cases;
*/

/*
LimitData:
timeLimit: the time limit use ms;
memoryLimit: the memory limit of problem use MB;
*/

type CaseData struct {
	Cnt  int      `json:"cnt" dc:"The number of items"`
	Data []string `json:"data" dc:"The input data"`
}

type LimitData struct {
	TimeLimit   int `json:"timeLimit" dc:"The time limit(ms)"`
	MemoryLimit int `json:"memoryLimit" dc:"The memory limit(MB)"`
}

type ProblemCreateReq struct {
	g.Meta  `path:"/api/problem/create" method:"post"`
	Title   string    `json:"title" dc:"Title of the problem"`
	Tag     []string  `json:"tag" dc:"Tag of the problem"`
	Rank    int       `json:"rank" dc:"Rank of the problem"`
	Dc      string    `json:"dc" dc:"DC of the problem"`
	Input   CaseData  `json:"input" dc:"Input data"`
	Output  CaseData  `json:"output" dc:"Output data"`
	ExDc    string    `json:"exDc" dc:"Extra Dc like data limit"`
	Limit   LimitData `json:"limit" dc:"Limit data"`
	Contest string    `json:"contest" dc:"Contest"`
}

type ProblemCreateRes struct {
	Pid string `json:"pid"`
}
